# Maintainer: Antonio Rojas <arojas@archlinux.com>

_pyname=jupyter_ydoc
pkgname=python-${_pyname//_/-}
pkgver=1.0.2
pkgrel=2
pkgdesc='Document structures for collaborative editing using Ypy'
arch=(any)
url='https://jupyter.org/'
license=(MIT)
depends=(python-ypy-websocket)
makedepends=(python-build python-installer python-hatchling python-hatch-nodejs-version)
checkdepends=(python-pytest-asyncio python-websockets)
source=(https://pypi.python.org/packages/source/${_pyname:0:1}/$_pyname/$_pyname-$pkgver.tar.gz)
sha256sums=('0f95bede3f1e081e07d5c57c03c658e3a5247e0ef18889074fbefa20dd3eca53')

build() {
  cd $_pyname-$pkgver
  python -m build --wheel --no-isolation
}

#check() {
#  cd $_pyname-$pkgver
#  python -m venv --system-site-packages test-env
#  test-env/bin/python -m installer dist/*.whl
#  test-env/bin/python -m pytest -v
#}

package() {
  cd $_pyname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
